/*
 * Copyright 2012-2014 glodon paas All right reserved. This software is the
 * confidential and proprietary information of glodon paas ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with glodon paas.
 */
package com.glodon.paas.monitor.web.controller;

import java.io.IOException;
import java.io.InputStream;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author licx 2013-2-1 下午3:04:12
 */
@Controller
public class VersionController {
	@RequestMapping("/version")
	public void version(HttpServletResponse resp) throws IOException {
		InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("version.properties");
		String versionInfo = IOUtils.toString(is);
		is.close();
		resp.getWriter().print(versionInfo);
	}
}
